#for循环打印九九乘法表1
for a in range(1,10):
    for b in range(1,10):
        if b<=a:
            print('{}*{}={:<2}'.format(a,b,a*b),end=' ')
    print('')
print('='*62)
for a in range(9,0,-1):
    for b in range(1,10):
        if b<=a:
            print('{}*{}={:<2}'.format(a,b,a*b),end=' ')
    print('')